import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css'
import '@/assets/styles/index.scss'

import Element from 'element-ui'
import './assets/styles/element-variables.scss'

import App from './App'
import store from './store'
import router from './router'

import './assets/icons'
import './permission'
import './utils/error-log'

// 分页组件
import Pagination from "@/components/Pagination";
// 文件上传组件
import FileUpload from "@/components/FileUpload"
// 图片上传组件
import ImageUpload from "@/components/ImageUpload"
// 字典数据组件
import DictData from '@/components/DictData'
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('FileUpload', FileUpload)
Vue.component('ImageUpload', ImageUpload)

DictData.install()

if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('../mock')
  mockXHR()
}

Vue.use(Element, {
  size: Cookies.get('size') || 'medium'
})

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
